package me.keiwu.user.dao;

import me.keiwu.user.domain.UserItem;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * Created by kei on 25/11/2017.
 */
public interface UserItemDao extends CrudRepository<UserItem, Integer> {

    int countAllByUserIdAndItemIdAndIsDelFalse(Long userId, Integer itemId);

    UserItem findByUserIdAndItemId(Long userId, Integer itemId);

    List<UserItem> findAllByUserId(Long userId);

    int countAllByUserIdAndItemTypeAndIsDelFalse(Long userId, Integer itemType);
}
